//
//  AIChatModel.h
//  Mia
//
//  Created by Vill on 2024/1/20.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger) {
    SocketConnectStatus_UnConnected       = 0<<0,//未连接状态
    SocketConnectStatus_Connected         = 1<<0,//连接状态
    SocketConnectStatus_DisconnectByUser  = 2<<0,//主动断开连接
    SocketConnectStatus_Unknow            = 3<<0 //未知
}SocketConnectStatus;        // 消息状态

typedef NS_ENUM(NSInteger){
    ChatMessageContentType_Login      = 0<<0, //登录消息
    ChatMessageContentType_Text       = 1<<0, //普通文本消息,表情..
    ChatMessageContentType_Audio      = 2<<0, //音频消息
    ChatMessageContentType_Picture    = 3<<0, //图片消息
    ChatMessageContentType_Video      = 4<<0, //视频消息
    ChatMessageContentType_PlatformGift = 5<<0, //平台礼物消息
    ChatMessageContentType_Gift       = 6<<0,  //礼物消息
    ChatMessageContentType_EndVideo   = 7<<0,  //结束视频聊天
}ChatMessageContentType;

typedef NS_ENUM(NSInteger){
    ChatMessageDirection_Send      = 0<<0, //登录消息
    ChatMessageDirection_Receive   = 1<<0, //普通文本消息,表情..
}ChatMessageDirectionType;

@class AIChatContentModel;
@class AIChatGiftModel;
@class AIChatHistoryModel;

@interface AIChatModel : NSObject

@property (nonatomic, copy) NSString *token; //消息发送者ID

@property (nonatomic, copy) NSString *chatType; //消息类型

@property (nonatomic, assign) NSInteger chatNumber; //聊天编号，此编号，服务器会回传，用于客户端保证一问一答

@property (nonatomic, strong) AIChatContentModel *data;

@property (nonatomic) ChatMessageDirectionType directionType;  // 消息发送者

@end


@interface AIChatContentModel : NSObject

// 注册登录时使用 是否是刚注册的用户，通过登录接口获取
@property (nonatomic, assign) BOOL isRegister;
//今日是否首次登录，此参数本地处理
@property (nonatomic, assign) BOOL dayFirstLogin;

//聊天内容，字符数量不能超过500
@property (nonatomic, copy) NSString *content;
//历史消息，注意只提交文本聊天类型消息，遵循一问一答为数量1，数量根据连上时返回的数量
@property (nonatomic, strong) NSArray <AIChatHistoryModel*>*historyMessages;
@property (nonatomic, copy) NSString *photoBase64;  //图片base64

@end


@interface AIChatHistoryModel : NSObject

@property (nonatomic, copy) NSString *content;  //"内容",
@property (nonatomic, copy) NSString *openAiRole; //角色类型 ASSISTANT=助手，USER=用户

@end

@interface AIResponse : NSObject

@property (nonatomic, assign) BOOL success;  //状态
//code 可以不处理  1001账号已停用  1003未注册  1004非法操作  01重复提交
//code 1000未登录 6001需要购买VIP弹窗  6002需要购买金币弹窗  6003亲密度升级弹窗
@property (nonatomic, copy) NSString *code;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, copy) NSString *data;  //加密data

@end

@interface AIChatResponseContentModel : NSObject

//聊天编号
@property (nonatomic, assign) NSInteger chatNumber;
//聊天回复是不是属于GPT的,历史消息只传达为true的对话
@property (nonatomic, assign) BOOL gptContent;
//回复内容
@property (nonatomic, copy) NSString *content;
//音频路径，如果没有此路径，请显示content
@property (nonatomic, copy) NSString *mp3url;
//等级名称
@property (nonatomic, copy) NSString *growthName;
//结束视频通话
@property (nonatomic, assign) BOOL endVideoChat;
//以下消息一般是code=6003才会返回  平台赠送的礼物信息,此礼物可以送给ai
@property (nonatomic, strong) AIChatGiftModel *platformGift;
//消息出现时间
@property (nonatomic, copy) NSString *messageTime;

@end


@interface AIChatGiftModel : NSObject

@property (nonatomic, copy) NSString *ID;
//礼物名称
@property (nonatomic, copy) NSString *name;
//礼物图片文件
@property (nonatomic, copy) NSString *imgUrl;
//svga文件
@property (nonatomic, copy) NSString *svgaUrl;
//所需金币数
@property (nonatomic, assign) NSInteger coinCount;


@end


NS_ASSUME_NONNULL_END
